#ifndef CUBE_EFFECT_H_
#define CUBE_EFFECT_H_

class Effect : public Asset
{
friend class PlayState;

DECLARE_RTTI( Effect, Asset )
public :
	typedef std::map< std::string, std::pair< std::string, D3DXHANDLE > >				ConstantTable;
	typedef std::map< std::string, D3DXHANDLE >											TechniqueTable;
	typedef std::map< D3DXHANDLE, std::vector< std::pair< std::string, D3DXHANDLE > > >	PassTable;

	~Effect();

	static Effect*			Create( const std::string& name, const std::string& path );

	D3DXHANDLE				GetConstantHandle( const std::string& name );
	ConstantTable&			GetConstantInfos(){ return _consts; }
	PassTable&				GetPassInfos(){ return _passes; }
	LPD3DXEFFECT			GetEffect(){ return _pEffect; }
	TechniqueTable&			GetTechniqueInfos(){ return _techs; }

	void					SetConstant( const std::string& name, const std::string& type );
	void					SetPass( const std::string& techName, const std::string& passName );
	void					SetTechniuqe( const std::string& name );

private :
	Effect( const std::string& name );

	ConstantTable			_consts;
	PassTable				_passes;
	LPD3DXEFFECT			_pEffect;
	TechniqueTable			_techs;
};

#endif